/**
 * Created by chenweicheng on 20/5/18.
 */
'use strict';

import {Dimensions, Platform} from 'react-native';

// device width/height
const deviceWidthDp = Dimensions.get('window').width;
const deviceHeightDp = (Platform.OS === 'ios') ? Dimensions.get('window').height : Dimensions.get('window').height - 25;
// design width/height
const uiHeightPx = 736;
const uiWidthPx = 414;

export function px2dpH(uiElementPx) {
    //console.log(deviceWidthDp);
    //console.log(deviceHeightDp);
    return uiElementPx * deviceHeightDp / uiHeightPx;
}
export function px2dpW(uiElementPx) {
    //console.log(deviceWidthDp);
    //console.log(deviceHeightDp);
    return uiElementPx * deviceWidthDp / uiWidthPx;
}


